<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<!-- Mirrored from www.wolfssl.com/wolfSSL/Blog/Entries/2011/8/5_Running_CyaSSL_on_the_Apple_TV_2.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Jan 2017 13:48:13 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="Generator" content="iWeb 3.0.4"/>
<meta name="iWeb-Build" content="local-build-20150706"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<meta name="viewport" content="width=700"/>
<title>Running CyaSSL on the Apple TV 2</title>
<link rel="stylesheet" type="text/css" media="screen,print" href="5_Running_CyaSSL_on_the_Apple_TV_2_files/5_Running_CyaSSL_on_the_Apple_TV_2.css"/>
<!--[if lt IE 8]><link rel='stylesheet' type='text/css' media='screen,print' href='5_Running_CyaSSL_on_the_Apple_TV_2_files/5_Running_CyaSSL_on_the_Apple_TV_2IE.css'/><![endif]-->
<!--[if gte IE 8]><link rel='stylesheet' type='text/css' media='screen,print' href='../../../../Media/IE8.css'/><![endif]-->
<script language="javascript" type="text/javascript">iWebBlogMainPageName='Blog.html';iWebBlogMainPageTitle='Blog';iWebBlogArchivePageName='Archive.html';iWebBlogArchivePageTitle='Archive';</script>
<script type="text/javascript" src="../../../../Scripts/iWebSite.js"></script>
<script type="text/javascript" src="../../../../Scripts/iWebImage.js"></script>
<script type="text/javascript" src="https://www.icloud.com/"></script>
<script type="text/javascript" src="../../../../Scripts/iWebBlog.js"></script>
<script type="text/javascript" src="5_Running_CyaSSL_on_the_Apple_TV_2_files/5_Running_CyaSSL_on_the_Apple_TV_2.js"></script>
 <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','../../../../../../www.google-analytics.com/analytics.js','ga');ga('create','UA-64826966-1','auto');ga('send','pageview');</script> <meta name="robots" content="follow,index"/></head>
<body style="background: rgb(255, 255, 255); margin: 0pt; " onload="onPageLoad();">
<div style="text-align: center; ">
<div style="margin-bottom: 0px; margin-left: auto; margin-right: auto; margin-top: 0px; overflow: hidden; position: relative; word-wrap: break-word;  background: rgb(255, 255, 255); text-align: left; width: 700px; " id="body_content">
<div style="float: left; margin-left: 0px; position: relative; width: 700px; z-index: 0; " id="nav_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
<div style="clear: both; height: 0px; line-height: 0px; " class="spacer"> </div>
</div>
<div style="height: 133px; margin-left: 0px; position: relative; width: 700px; z-index: 10; " id="header_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
<div style="height: 37px; width: 545px;  height: 37px; left: 155px; position: absolute; top: 100px; width: 545px; z-index: 1; " class="tinyText shadow_0">
<div style="position: relative; width: 545px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_1.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 545px; "/>
</div>
</div>
<div id="id1" style="height: 25px; left: 164px; position: absolute; top: 104px; width: 43px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content style_External_43_25" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style"><a class="class1" title="../../../../Home.html" href="../../../../Home.html">Home</a></p>
</div>
</div>
</div>
<div id="id2" style="height: 28px; left: 327px; position: absolute; top: 104px; width: 74px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_74_28" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class2" title="../../../../Download.html" href="https://wolfssl.com/wolfSSL/download/downloadm.php">Download</a></p>
</div>
</div>
</div>
<div id="id3" style="height: 27px; left: 403px; position: absolute; top: 104px; width: 58px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_58_27" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class3" title="../../../../License.html" href="../../../../License.html">License</a></p>
</div>
</div>
</div>
<div id="id4" style="height: 29px; left: 463px; position: absolute; top: 104px; width: 44px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_44_29" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class4" title="../../../Blog.html" href="../../../Blog.html">Blog</a></p>
</div>
</div>
</div>
<div id="id5" style="height: 27px; left: 554px; position: absolute; top: 104px; width: 80px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_80_27" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class5" title="../../../../Community.html" href="../../../../Community.html">Community</a></p>
</div>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 209px; position: absolute; top: 101px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_2.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 260px; position: absolute; top: 100px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_3.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 327px; position: absolute; top: 101px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_4.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 402px; position: absolute; top: 101px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_5.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 462px; position: absolute; top: 100px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_6.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 553px; position: absolute; top: 100px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_7.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div id="id6" style="height: 29px; left: 634px; position: absolute; top: 104px; width: 65px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_65_29" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class6" title="../../../../Contact.html" href="../../../../Contact.html">Contact</a></p>
</div>
</div>
</div>
<div id="id7" style="height: 26px; left: 209px; position: absolute; top: 104px; width: 52px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_52_26" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class7" title="../../../../About.html" href="../../../../About.html">About</a></p>
</div>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 634px; position: absolute; top: 101px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_8.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div id="id8" style="height: 25px; left: 261px; position: absolute; top: 104px; width: 65px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content style_External_65_25" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class8" title="../../../../Products.html" href="../../../../Products.html">Products</a></p>
</div>
</div>
</div>
<div id="id9" style="height: 25px; left: 510px; position: absolute; top: 104px; width: 44px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content style_External_44_25" style="padding: 0px; ">
<div class="style">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_1"><a class="class9" title="../../../../Docs.html" href="../../../../Docs.html">Docs</a></p>
</div>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 509px; position: absolute; top: 100px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/shapeimage_9.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
</div>
<div style="margin-left: 0px; position: relative; width: 700px; z-index: 5; " id="body_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
<div style="height: 353px; width: 440px;  height: 353px; left: 0px; position: absolute; top: 149px; width: 440px; z-index: 1; " class="tinyText style_SkipStroke_2">
<img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/cyassl_atv2.png" alt="" style="border: none; height: 354px; width: 440px; visibility: hidden; " id="generic-picture-attributes"/>
</div>
<div id="id10" style="visibility: hidden;  height: 32px; left: 0px; position: absolute; top: 75px; width: 682px; z-index: 1; " class="style_SkipStroke_3 shape-with-text">
<div class="text-content Normal_External_682_32" style="padding: 0px; ">
<div class="Normal">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_2">Running CyaSSL on the Apple TV 2</p>
</div>
</div>
<div id="generic-title-attributes" class="Title"></div>
</div>
<div style="height: 1px; line-height: 1px; " class="tinyText"> </div>
<div style="visibility: hidden;  margin-left: 0px; margin-top: 522px; position: relative; width: 681px; z-index: 1; " class="style_SkipStroke_4 shape-with-text flowDefining">
<div class="text-content style_External_681_954" style="padding: 0px; ">
<div class="style_1">
<p style="padding-top: 0pt; " class="paragraph_style_3">The Apple TV brought with it a long list of desirable and useful features for the home - including high usability, a small form factor, easy setup, and low cost.  We here at yaSSL are users and fans of the second generation Apple TV, and as such, recently ported the CyaSSL embedded SSL library to the Apple TV 2.  We were quite surprised by how easy it was to get CyaSSL up and running.<br/></p>
<p class="paragraph_style_3"><br/></p>
<p class="paragraph_style_3">The Apple TV 2 runs iOS with the Apple A4 (ARM Cortex-A8) processor and is equipped with 256 Mb of RAM and a 8GB flash drive, giving it more than enough space and speed to effectively run CyaSSL.<br/></p>
<p class="paragraph_style_3"><br/></p>
<p class="paragraph_style_4">Installation<br/></p>
<p class="paragraph_style_3"><br/></p>
<ol>
<li style="line-height: 18px; padding-left: 13px; text-indent: -13px; " class="full-width" value="1">
<p style="text-indent: -13px; " class="paragraph_style_5"><span style="font-size: 12px; " class="Bullet">1.</span><span style="width: 3px; " class="inline-block"></span> Jailbreak your Apple TV<br/></p>
</li>
</ol>
<p class="paragraph_style_3">Installation of CyaSSL onto the Apple TV requires that the TV be jailbroken first. There are any number of readily-accessible posts around the internet explaining this process, therefore, we will leave this step up to you.<br/></p>
<p class="paragraph_style_3"><br/></p>
<ol>
<li style="line-height: 18px; padding-left: 13px; text-indent: -13px; " class="full-width" value="2">
<p style="text-indent: -13px; " class="paragraph_style_6"><span style="font-size: 12px; " class="Bullet">2.</span><span style="width: 3px; " class="inline-block"></span> Cross compile CyaSSL for iOS and ARM<br/></p>
</li>
</ol>
<p class="paragraph_style_7">For this step, we used a modified version of a script written by Michael Aaron Safyan to cross compile libraries for iOS.  You can find our modified version of the script for iOS 4.3 and the armv7 architecture, here: <a title="http://www.yassl.com/files/scripts/iOS4.3-configure.sh" href="http://www.yassl.com/files/scripts/iOS4.3-configure.sh">Cross Compile Script</a>.  This script uses the ARM toolchain from the iOS Developer tools that come with the iPhone SDK.  It sets environment variables, then runs CyaSSL’s normal ./configure script.<br/></p>
<p class="paragraph_style_7"><br/></p>
<p class="paragraph_style_7">If you want to change the location where CyaSSL is installed, you can edit the script to adjust for your desired directory location.  To build CyaSSL, place the cross compile script (iOS4.3-configure.sh) in the root directory of the CyaSSL download and run the following commands.  This builds CyaSSL with the --enable-fastmath option.<br/></p>
<p class="paragraph_style_7"><br/></p>
<p class="paragraph_style_7">./iOS4.3-configure.sh<br/></p>
<p class="paragraph_style_7">make<br/></p>
<p class="paragraph_style_7">sudo make install<br/></p>
<p class="paragraph_style_7"><br/></p>
<p class="paragraph_style_7">If unaltered, this will install the cross-compiled CyaSSL library into /usr/local/cyassl_atv2.<br/></p>
<p class="paragraph_style_7"><br/></p>
<ol>
<li style="line-height: 18px; padding-left: 13px; text-indent: -13px; " class="full-width" value="3">
<p style="text-indent: -13px; " class="paragraph_style_8"><span style="font-size: 12px; " class="Bullet">3.</span><span style="width: 3px; " class="inline-block"></span> Copy CyaSSL to the Apple TV<br/></p>
</li>
</ol>
<p class="paragraph_style_9">Use your favorite FTP client to upload the contents of the /usr/local/cyassl_atv2 directory to the same location on your second generation Apple TV.  If desired, you can also copy additional CyaSSL elements to the Apple TV such as the CTaoCrypt benchmark utility, the CyaSSL testsuite, or examples.  We chose to place these on the Apple TV under the /var/mobile/Applications/cyassl directory.<br/></p>
<p class="paragraph_style_9"><br/></p>
<ol>
<li style="line-height: 18px; padding-left: 13px; text-indent: -13px; " class="full-width" value="4">
<p style="text-indent: -13px; " class="paragraph_style_10"><span style="font-size: 12px; " class="Bullet">4.</span><span style="width: 3px; " class="inline-block"></span> Benchmark Results<br/></p>
</li>
</ol>
<p class="paragraph_style_11">Our results of running the CTaoCrypt benchmark application are below:<br/></p>
<p class="paragraph_style_11"><br/></p>
<p class="paragraph_style_11">AES         5 megs took 0.500 seconds,   9.99 MB/s<br/></p>
<p class="paragraph_style_11">ARC4      5 megs took 0.174 seconds,  28.66 MB/s<br/></p>
<p class="paragraph_style_11">RABBIT   5 megs took 0.126 seconds,  39.56 MB/s<br/></p>
<p class="paragraph_style_11">3DES       5 megs took 2.196 seconds,   2.28 MB/s<br/></p>
<p class="paragraph_style_11"><br/></p>
<p class="paragraph_style_11">MD5        5 megs took 0.163 seconds,  30.73 MB/s<br/></p>
<p class="paragraph_style_11">SHA        5 megs took 0.137 seconds,  36.61 MB/s<br/></p>
<p class="paragraph_style_11">SHA-256  5 megs took 0.309 seconds,  16.20 MB/s<br/></p>
<p class="paragraph_style_11"><br/></p>
<p class="paragraph_style_11">RSA 1024 encryption took   1.12 milliseconds, avg over 100 iterations<br/></p>
<p class="paragraph_style_11">RSA 1024 decryption took  17.81 milliseconds, avg over 100 iterations<br/></p>
<p class="paragraph_style_11">DH  1024 key generation   11.90 milliseconds, avg over 100 iterations<br/></p>
<p class="paragraph_style_11">DH  1024 key agreement    11.22 milliseconds, avg over 100 iterations<br/></p>
<p class="paragraph_style_11"><br/></p>
<p class="paragraph_style_11"><br/></p>
<p style="padding-bottom: 0pt; " class="paragraph_style_11">If you have any questions or comments about our port to the Apple TV, please let us know at <a class="__cf_email__" href="https://www.wolfssl.com/cdn-cgi/l/email-protection" data-cfemail="ec85828a83ac958d9f9f80c28f8381c22e4c">[email&#160;protected]</a><script data-cfhash='f9e31' type="text/javascript">/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */</script> We’d be happy to hear what you think!</p>
</div>
</div>
<div id="generic-body-attributes" class="Body"></div>
</div>
<div id="id11" style="visibility: hidden;  height: 24px; left: 1px; position: absolute; top: 107px; width: 681px; z-index: 1; " class="style_SkipStroke_5 shape-with-text">
<div class="text-content style_External_681_24" style="padding: 0px; ">
<div class="style_1">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_12">Friday, August 5, 2011</p>
</div>
</div>
<div id="generic-datefield-attributes" class="Date"></div>
</div>
<div id="id12" style="height: 30px; left: 358px; position: absolute; top: 1498px; width: 315px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_315_30" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="Next"><a class="iWebBlogNext" title="" href="#">next &gt;</a></p>
</div>
</div>
</div>
<div id="id13" style="height: 30px; left: 6px; position: absolute; top: 1498px; width: 315px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_315_30" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="Previous"><a class="iWebBlogPrev" title="" href="#">&lt; previous</a></p>
</div>
</div>
</div>
<div style="height: 130px; width: 132px;  height: 130px; left: 8px; position: absolute; top: -116px; width: 132px; z-index: 1; " class="tinyText style_SkipStroke_6">
<a href="../../../../Home.html" title="../../../../Home.html"><img src="5_Running_CyaSSL_on_the_Apple_TV_2_files/yassl_logo.png" alt="" style="border: none; height: 130px; width: 132px; "/></a>
</div>
<div id="id14" style="height: 27px; left: 569px; position: absolute; top: 100px; width: 110px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_110_27" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="Body">tweet_button</p>
</div>
</div>
</div>
<div id="id15" style="height: 27px; left: 463px; position: absolute; top: 100px; width: 104px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_104_27" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="Body">digg_button</p>
</div>
</div>
</div>
<div style="height: 51px; line-height: 51px; " class="spacer"> </div>
</div>
<div style="height: 150px; margin-left: 0px; position: relative; width: 700px; z-index: 15; " id="footer_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
</div>
</div>
</div>
 </body>

<!-- Mirrored from www.wolfssl.com/wolfSSL/Blog/Entries/2011/8/5_Running_CyaSSL_on_the_Apple_TV_2.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Jan 2017 13:48:21 GMT -->
</html>
